package com.ssy.lingxi.scheduler.api.handler.annotation;

import com.ssy.lingxi.scheduler.api.handler.validator.TimestampValidator;

import javax.validation.Constraint;
import javax.validation.Payload;
import java.lang.annotation.*;

/**
 * Unix时间戳校验注解
 * @author 万宁
 * @version 2.0.0
 * @date 2021-07-12
 */
@Target({ElementType.METHOD, ElementType.FIELD, ElementType.ANNOTATION_TYPE, ElementType.CONSTRUCTOR, ElementType.PARAMETER})
@Documented
@Retention(RetentionPolicy.RUNTIME)
@Constraint(validatedBy = TimestampValidator.class)
public @interface TimestampAnnotation {

    boolean nullable() default false;

    String message() default "任务执行时间要大于当前时间";

    Class<?>[] groups() default {};

    Class<? extends Payload>[] payload() default {};
}
